<html>
<head><meta charset="utf-8"><title>Miri dealloc hook · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Miri.20dealloc.20hook.html">Miri dealloc hook</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="193487299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Miri%20dealloc%20hook/near/193487299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yato <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Miri.20dealloc.20hook.html#193487299">(Apr 09 2020 at 18:03)</a>:</h4>
<p>I opened an issue for miri to track deallocations with a flag, and <span class="user-mention" data-user-id="120791">@RalfJ</span> said that this would require a machine hook. So I looked into that and I'm a bit stuck, (is this the right place to ask?)</p>
<p>I assume that we need to add a new function to <a href="https://github.com/rust-lang/rust/blob/93dc97a85381cc52eb872d27e50e4d518926a27c/src/librustc_mir/interpret/machine.rs#L80" title="https://github.com/rust-lang/rust/blob/93dc97a85381cc52eb872d27e50e4d518926a27c/src/librustc_mir/interpret/machine.rs#L80"><code>trait Machine</code></a>, then I would need to call that function when deallocating <a href="https://github.com/rust-lang/rust/blob/42abbd8878d3b67238f3611b0587c704ba94f39c/src/librustc_mir/interpret/memory.rs#L242-L247" title="https://github.com/rust-lang/rust/blob/42abbd8878d3b67238f3611b0587c704ba94f39c/src/librustc_mir/interpret/memory.rs#L242-L247">here</a>. Then I need print out the diagnostic, I think I can base that off of the <code>CreateAlloc</code> diagnostic.</p>



<a name="193487359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Miri%20dealloc%20hook/near/193487359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yato <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Miri.20dealloc.20hook.html#193487359">(Apr 09 2020 at 18:04)</a>:</h4>
<p>this issue: <a href="https://github.com/rust-lang/miri/issues/1314" title="https://github.com/rust-lang/miri/issues/1314">https://github.com/rust-lang/miri/issues/1314</a></p>



<a name="193521523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Miri%20dealloc%20hook/near/193521523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yato <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Miri.20dealloc.20hook.html#193521523">(Apr 09 2020 at 23:13)</a>:</h4>
<p>I have filed a PR with the described changes: <a href="https://github.com/rust-lang/rust/pull/70962" title="https://github.com/rust-lang/rust/pull/70962">https://github.com/rust-lang/rust/pull/70962</a></p>



<a name="193548880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/Miri%20dealloc%20hook/near/193548880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/Miri.20dealloc.20hook.html#193548880">(Apr 10 2020 at 08:38)</a>:</h4>
<p>Thanks for working on this. :) Let's talk in the PR then.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>